Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: refactor oci/helm tests for registryproviders #1113

Merged

Conversation

sdowell
Copy link
Contributor

@sdowell sdowell commented Jan 26, 2024

This refactors the existing helm-sync/oci-sync tests which push artifacts to use the new RegistryProvider interface. This delivers a few benefits:

  • minimize duplicate test scaffolding
  • enable running these tests without GKE/AR
  • enable running these tests with the presubmits in kind

@sdowell
Copy link
Contributor Author

sdowell commented Jan 26, 2024

/assign @karlkfi

@sdowell
Copy link
Contributor Author

sdowell commented Jan 30, 2024

/cc @nan-yu

@sdowell
Copy link
Contributor Author

sdowell commented Feb 5, 2024

/retest

e2e/nomostest/config_sync.go Show resolved Hide resolved
@@ -499,6 +499,28 @@ func (g *Repository) Copy(sourceDir, destDir string) error {
return err
}

// UseHelmChart copies the files from the provided helm chart to the current
// repository.
func (g *Repository) UseHelmChart(chart string) error {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not the same repository when switching from Git to Helm. I feel like it makes more sense to copy the files when building the Helm chart.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idea here is that we can use the same Repository object as a primitive for creating all types of artifacts (git, oci, helm). There are tests which use the pattern of adding individual files for a helm chart and pushing it, this is just intended as a convenience function to copy over the premade helm charts from the local directory.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had the same confusion looking at the Repository. I expected two interfaces, one for helm and one for OCI. Having them in the same interface feels like leaking implementation details.

e2e/nomostest/ntopts/new.go Show resolved Hide resolved
@sdowell sdowell force-pushed the local-registry-provider branch 2 times, most recently from 7578a1e to 753a645 Compare February 5, 2024 19:57
e2e/flags.go Outdated Show resolved Hide resolved
This refactors the existing helm-sync/oci-sync tests which push
artifacts to use the new RegistryProvider interface. This delivers a few
benefits:
- minimize duplicate test scaffolding
- enable running these tests without GKE/AR
- enable running these tests with the presubmits in kind
@sdowell
Copy link
Contributor Author

sdowell commented Feb 6, 2024

/retest

Copy link
Contributor

@karlkfi karlkfi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

thanks for cleaning it up a bit. we can always clean it up more later if we feel like it.

@google-oss-prow google-oss-prow bot added the lgtm label Feb 7, 2024
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: karlkfi

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@google-oss-prow google-oss-prow bot merged commit c0f0c59 into GoogleContainerTools:main Feb 7, 2024
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants